Conversation
Fix a check from `log::warn! -> ensure!`, add more comments to each, and order them for legibility.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Fuzzer ValidationThe below text demonstrates the two fuzzers from Each log line shows Example 1: Redeem does not decrease PsmDebt
Caught by Check 2 ( Stateful tester — seed=4, caught at command 5Commands 2 and 4 build debt and reserves to 749.9K. Command 5 redeems: reserve drops to 259.9K but debt stays at 749.9K. libFuzzer — found independently via coverage-guided mutationFound within ~512 iterations from the existing corpus: Reproduce: cd substrate/frame/psm
# Comment out PsmDebt::mutate in redeem() at line 620, then:
cargo +nightly fuzz run psmExample 2: Redeem burns
|
Description
This PR is a follow-up to #11068. It contains suggestions - for
try_statechecks and pallet unit tests - that were not made before it was merged.It is also a companion to open-web3-stack/polkadot-ecosystem-tests#592 .
Any comments or suggestions appreciated (pinging @lrazovic since you authored #11068).
Integration
N/A
Review Notes
try_statechecks topallet-psmfn do_try_stateon valid statedo_try_statefails appropriately on several different kinds of invalidpallet-psmstatespallet-psmfuzz_targets/psm.rs): multi-block sequences, state-aware amount generation, weighted call selection,do_try_statevalidation after each blockfuzz_targets/psm_stateful.rs): deterministic seed, full state snapshots, dynamic candidate generation based on preconditions,do_try_statevalidation after every commanddo_try_stateinvariants including the cross-pallet issuance checkmock.rsextended with fuzzing feature gate, additional assets (DAI, USDP, FRAX), andfuzz_helpersmodulefuzz/README.mddocumenting both fuzzers, when to use which, and build instructions